import 'package:flutter/material.dart';
import 'package:flutter02/res/list_data.dart';

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    return Stack(
      children: [
        ListView.builder(
            padding: const EdgeInsets.only(bottom: 50),
            itemCount: listData.length,
            itemBuilder: (context, index) {
              return ListTile(
                leading: SizedBox(
                  width: 100,
                  height: 100,
                  child: Image.network(
                    listData[index]['imageUrl'],
                    fit: BoxFit.cover,
                  ),
                ),
                title: Text("$index.${listData[index]['title']}"),
                subtitle: Text(listData[index]['author']),
              );
            }),
        Positioned(
            left: 0,
            bottom: 0,
            width: size.width,
            height: 44,
            child: Container(
              alignment: Alignment.center,
              color: Colors.black,
              child: const Text(
                "二级导航",
                style: TextStyle(color: Colors.white),
              ),
            ))
      ],
    );
  }
}
